<?php

namespace App\Http\Controllers\Admin;

use App\Http\Query\CategoryQuery;
use app\Model\Base;
use app\Model\OrderModel;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use Log;
use function MongoDB\BSON\toJSON;
use SplFileObject;

class JapanNotpaiedController extends Controller

{

    function notpaied_list(Request $request)
    {
        $param = $request->all();
        $map['deliver_state'] = 1;//已经发货的
        $map['state'] = 1;//没有支付的
        $db = DB::table('user_order')->where($map);

        if(!empty($param['star_date']) && !empty($param['end_date'])){
            $list = $db->whereBetween('create_time',[$param['star_date'],$param['end_date']])->get();
        }else{
            $list = $db->get();
        }

        return view('warehouse.notpaied_list', array(
            'list' => $list,
            'param' =>$param
        )); // 返回视图
    }
}
